package com.nodecollege.cloud.client.fallback;

import com.nodecollege.cloud.client.feign.ChatDebateClient;
import com.nodecollege.cloud.common.model.DebateDTO;
import com.nodecollege.cloud.common.model.NCResult;
import com.nodecollege.cloud.common.model.po.ChatDebate;
import com.nodecollege.cloud.common.model.po.ChatDebateRelation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author LC
 * @date 2020/4/19 17:59
 */
@Slf4j
@Component
public class ChatDebateClientFallback implements ChatDebateClient {
    @Override
    public NCResult<ChatDebate> addDebateApi(DebateDTO debate) {
        String message = "chat-addDebateApi 添加辩论堂失败！中台熔断器——调用接口出现异常！";
        log.error(message);
        return NCResult.error("-1", message);
    }

    @Override
    public NCResult addRelation(List<ChatDebateRelation> relationList) {
        String message = "chat-addRelation 添加节点和辩论堂关系失败！中台熔断器——调用接口出现异常！";
        log.error(message);
        return NCResult.error("-1", message);
    }

    @Override
    public NCResult<ChatDebate> getDebateCache(ChatDebate debate) {
        String message = "chat-getDebateCache 查询辩论堂缓存失败！中台熔断器——调用接口出现异常！";
        log.error(message);
        return NCResult.error("-1", message);
    }
}
